home *** CD-ROM | disk | FTP | other *** search
/ Champak 109 / Vol 109.iso / games / free_sty.swf / scripts / DefineSprite_164 / frame_47 / DoAction.as
Text File  |  2008-11-12  |  528b  |  18 lines

  1. var vv = 15;
  2. var mxx = _root.bg_mc.man._x + _root.bg_mc.man._width;
  3. var myy = _root.bg_mc.man._y - _root.bg_mc.man._height;
  4. var bxx = _root.zhu_array[_root.level][this.upn][0];
  5. var byy = _root.zhu_array[_root.level][this.upn][1];
  6. if((mxx - bxx) * (mxx - bxx) + (myy - byy) * (myy - byy) > this.vv * this.vv)
  7. {
  8.    var jj = Math.atan2(byy - myy,bxx - mxx);
  9.    this._x += this.vv * Math.cos(jj);
  10.    this._y += this.vv * Math.sin(jj);
  11. }
  12. else
  13. {
  14.    this._x = bxx;
  15.    this._y = byy;
  16.    this.gotoAndPlay("Σ╕èτê¼d2");
  17. }
  18.